import request from '@/utils/request';

// 查询生产计划BOM组成列表
export function listBom(query) {
  return request({
    url: '/mes/pro/planningbom/list',
    method: 'get',
    params: query
  });
}

// 查询生产计划BOM组成详细
export function getBom(lineId) {
  return request({
    url: '/mes/pro/planningbom/' + lineId,
    method: 'get'
  });
}

// 新增生产计划BOM组成
export function addBom(data) {
  return request({
    url: '/mes/pro/planningbom',
    method: 'post',
    data: data
  });
}

// 修改生产计划BOM组成
export function updateBom(data) {
  return request({
    url: '/mes/pro/planningbom',
    method: 'put',
    data: data
  });
}

// 删除生产计划BOM组成
export function delBom(lineId) {
  return request({
    url: '/mes/pro/planningbom/' + lineId,
    method: 'delete'
  });
}

// 查询生产计划BOM组成列表
export function materielList(query) {
  return request({
    url: '/mes/pro/planningbom/materielList',
    method: 'post',
    data: query
  });
}

// 查询生产计划BOM组成列表
export function productList(query) {
  return request({
    url: '/mes/pro/planningbom/productList',
    method: 'get',
    params: query
  });
}

// 新增生产计划BOM组成
export function addList(data) {
  return request({
    url: '/mes/pro/planningbom/addList',
    method: 'post',
    data: data
  });
}
// 查询销售订单的关联所有计划的bom的第一级
export function getBomLevelOneByOrder(orderCode) {
  return request({
    url: '/mes/pro/planningbom/getBomLevelOneByOrder/' + orderCode,
    method: 'get'
  });
}
